package cn.jx.asc.controller;

import cn.jx.asc.common.enums.ResultStatus;
import cn.jx.asc.common.response.Result;
import cn.jx.asc.common.response.ResultUtils;
import cn.jx.asc.monitor.Server;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;


/**
 * 系统监控
 *
 * @author lhg
 */

@Api(value = "系统监控",tags ={"系统监控的相关接口"} )
@RestController
@RequestMapping("/sysMonitor")
public class MonitorController {

    @RequiresRoles("ADMIN")
    @ApiOperation(value = "服务器监控", notes = "服务器监控", httpMethod = "GET")
    @GetMapping("/server")
    public Result server() throws Exception {
        Server server = new Server();
            server.copyTo();

        return ResultUtils.resultWithData(ResultStatus.SUCCESS,server);
    }

}
